package com.zjp.mg.config;

import org.springframework.data.mongodb.core.messaging.Message;
import org.springframework.data.mongodb.core.messaging.MessageListener;
import org.springframework.stereotype.Component;

@Component
public class DocumentMessageListener<S,T> implements MessageListener<S, T> {

    @Override
    public void onMessage(Message<S, T> message) {
        System.out.printf("Received Message in collection %s.\n\trawsource: %s\n\tconverted: %s%n",
                message.getProperties().getCollectionName(), message.getRaw(), message.getBody());
    }
}
